﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace VsxFactory.Modeling.Repository
{
    public class PackageSource 
    {
        public string Name { get; private set; }
        public string Source { get; internal set; }

        public PackageSource(string name, string source)
        {
            System.Diagnostics.Contracts.Contract.Requires(!String.IsNullOrWhiteSpace(name));
            System.Diagnostics.Contracts.Contract.Requires(!String.IsNullOrWhiteSpace(source));
            Name = name;
            Source = source;
        }

        public Uri SourceAsUri { get { return new Uri(Source); } }

        public string DisplayName { get { return this.ToString(); } }
        public override string ToString()
        {
            return Name + " [" + Source + "]";
        }
    }
}
